[#include "/WEB-INF/pages/common/taglibs.ftl"]

	<div id="article" class="article_list">
		<a href="${action.backurl}" >返回</a>
		[#--指定操作--]
		<form action="[@c.url value='/manage/Article_${act}.action?backurl=${action.backurl}'/]" method="post">
			<input type="hidden" name="id" value="${(article.id)!''}" />
			<input type="hidden" name="article.id" value="${(article.id)!''}" />
			<table>
				<caption>文章的数据内容</caption>
				<tr>
					<th>所属栏目：[#--[@fmt.message key="manage.category"/] --]</th>
					<td>
						<select name="article.categoryId" class="">
						[#list categoryList as c]
							<option value="${c.id}" [#if categoryId == c.id]selected="selected"[/#if] >${c.name}</option>
						[/#list]
						</select>
					</td>
					<th>类型：[#--[@fmt.message key="manage.article.type"/]--]</th>
					<td><input type="text" placeholder="?" name="article.type" value="${(article.type)!''}"/></td>
				</tr>
				<tr>
					<th>标题：</th>
					<td colspan=3><input type="text" placeholder="?" name="article.title" value="${(article.title)!''}"/></td>
				</tr>
				<tr>
					<th>简短标题：</th>
					<td><input type="text" placeholder="?" name="article.shortTitle" value="${(article.shortTitle)!''}"/></td>
					<th>1</th>
					<td>2</td>
				</tr>
				<tr>
					<th>文章来源：</th>
					<td><input type="text" placeholder="?" name="article.origin" value="${(article.origin)!''}"/></td>
					<th>文章作者：</th>
					<td><input type="text" placeholder="?" name="article.author" value="${(article.author)!''}"/></td>
				</tr>
				<tr>
					<th>关键字：</th>
					<td><input type="text" placeholder="?" name="article.keyWords" value="${(article.keyWords)!''}"/></td>
					<th>标签：</th>
					<td><input type="text" placeholder="?" name="article.tags" value="${(article.tags)!''}"/></td>
				</tr>
				<tr>
					<th>文章摘要：</th>
					<td colspan="3"><textarea maxlength="255" name="article.description">${(article.description)!''}</textarea></td>
				</tr>
				<tr>
					<th>模板</th>
					<td colspan="3">
						<select name="article.templateId">
							<option value=""></option>
							[#list templateList as template]
								<option value="${template.id}" [#if (article.templateId)?? && template.id==article.templateId]selected="selected"[/#if] >${template.name}</option>
							[/#list]
						</select><input id="templateEdit" type="button" value="编辑"/>
					</td>
				</tr>
				<tr>
					<th>置顶级别：</th>
					<td><input type="text" placeholder="?" name="article.topLevel" value="${(article.topLevel)!''}"/></td>
					<th>审核级别：</th>
					<td><input type="text" placeholder="?" name="article.checkLevel" value="${(article.checkLevel)!''}"/></td>
				</tr>
				<tr>
					<th>发布：</th>
					<td><select id="" name="article.draft">
							<option value="true" [#if (article == null || article.draft == true)??]checked[/#if]>草稿</option>
							<option value="false" [#if (article != null && article.draft == false)??]checked[/#if]>正式</option>
						</select>
					</td>
					<th>是否推荐：</th>
					<td><label for="" >是</label><input type="radio" name="article.recommend" value="true" [#if article == null || (article.recommend ==true)]checked[/#if]/>
						<label for="" >否</label><input type="radio" name="article.recommend" value="false" [#if (article != null && article.recommend == false)]checked[/#if]/>
					</td>
				</tr>
				<tr>
					<th>外部链接：</th>
					<td><input type="text" placeholder="?" name="article.outerUrl" value="${(article.outerUrl)!''}"/></td>
					<th>发布时间：</th>
					<td><input type="text" placeholder="?" name="article.publishDate" value="[#if (article.publishDate)??]${(article.publishDate)?string('yyyy-MM-dd')}[/#if]"/></td>
				</tr>
				<tr>
					<th>允许评论：</th>
					<td><label for="" >允许</label><input type="radio" name="article.comment" value="true" [#if article == null || (article.comment ==true)]checked[/#if]/>
						<label for="" >拒绝</label><input type="radio" name="article.comment" value="false" [#if (article != null && article.comment == false)]checked[/#if] />
						[#if article == null || (article.comment ==true)]评论数量：${(article.commentCount)!0}[/#if]
					</td>
					<th>分析统计：</th>
					<td>是<input type="radio" name="article.analyse" value="true" [#if article == null || (article.analyse ==true)]checked[/#if]/>
						否<input type="radio" name="article.analyse" value="false" [#if (article != null && article.analyse == false)]checked[/#if] />
						允许分析统计时,由扩展表提供数据,自定义表单提供表单样式
					</td>
				</tr>
				<tr>
					<th>需要审核：</th>
					<td><label for="" >是</label><input type="radio" name="article.check" value="true" [#if article == null || (article.check == true)]checked[/#if]/>
						<label for="" >否</label><input type="radio" name="article.check" value="false" [#if (article != null && article.check == false)]checked[/#if] />
						[#if article == null || (article.check == true)]
							[#if article == null || (article.reject) == true]
								审核通过
							[#else]
								审核未通过
							[/#if]
						[/#if]
					</td>
					<th>访问权限：</th>
					<td>
						<label for="" >授权</label><input type="radio" name="article.permission" value="true" [#if article == null || (article.permission ==true)]checked[/#if]/>
						<label for="" >开放</label><input type="radio" name="article.permission" value="false" [#if (article != null && article.permission == false)]checked[/#if] />
						需要授权，查找扩展表，找到授权方式
					</td>
				</tr>
				<tr>
					<th>文章语言：</th>
					<td><select name="article.i18n">
							[#list configI18N.configItemList as item]
								<option value="${item.value}" [#if (article.i18n)?? && item.value==article.i18n]selected="selected"[/#if]>${item.name}</option>
							[/#list]
						</select></td>
					<th>备注：</th>
					<td><textarea placeholder="?" name="article.notes">${(article.notes)!''}</textarea></td>
				</tr>
				<tr>
				<!--图片上传预览-->
					<th>缩略图设置：</th>
					<td>
						<div style="float:left;">
							<img id="titleImageReview" src='[@c.url value="${(article.titleImg)!''}"/]' />
						</div>
						<div style="float:left;">
				            <div class="span7">
				                <span class="btn btn-success fileinput-button">
				                    <i class="icon-picture icon-white"></i>
				                    <span>选择图片</span>
				                    <input type="text" actkey="thumb" actval="kcfinder_div" readonly="readonly" value="${(article.titleImg)!''}" style="width:600px;cursor:pointer" /><br />
				                </span>
				            </div>
				            <!--图片剪切设置-->
				            <div class="span7">
				                <span class="btn btn-success fileinput-button">
				                    <i class="icon-pencil icon-white"></i>
				                    <span>剪切图片</span>
				                    <!-- actkey=动作,actval=操作值-->
				                    <input id="cutImage" actkey="cut" actval="titleImageReview" type="text" readonly="readonly" style="width:600px;cursor:pointer"/><br />
				                </span>
				            </div>
				             <!--清除预览图片-->
				            <div class="span7">
				                <!-- The fileinput-button span is used to style the file input field as button -->
				                <span class="btn btn-success fileinput-button">
				                    <i class="icon-pencil icon-white"></i>
				                    <span>清除图片</span>
				                    <!-- actkey=动作,actval=操作值-->
				                    <input id="clearImage" actkey="cut" actval="titleImageReview" type="text" readonly="readonly" style="width:600px;cursor:pointer"/><br />
				                </span>
				            </div>
				            <div id="kcfinder_div"></div>
						</div>
					</td>
					<th>预览：</th>
					<td><div style="width:120px;height:90px;overflow:hidden;margin-left:5px;">
							<img id="preview" src='${(article.titleImg)!''}' style="" />
						</div>
						<div>
							<p></p>
							<p style="margin-left:5px;">
								<input type="text" id="thumb-vx" maxlength="4" style="width:25px;"/>X
								<input type="text" id="thumb-vy" maxlength="4" style="width:25px;"/>
							</p>
						</div>
						<div>
							<p><img id="titleImg" src='${(article.titleImg)!''}' style="" /></p>
							<input id="titleImgHidden" type="hidden" name="article.titleImg" value=""/>
						</div>
					</td>
				</tr>
				<tr>
					<th>内容图片设置：</th>
					<td>
						<p>
					        <div class="fileupload-buttonbar">
								<div class="span7">
					                <span class="btn btn-success fileinput-button">
					                    <i class="icon-plus icon-white"></i>
					                    <span></span>
					                    <input type="button" name="article.contentImg" value="${(article.contentImg)!''}"/>
					                </span>
					                <button type="submit" class="btn btn-primary start">
					                    <i class="icon-upload icon-white"></i>
					                    <span></span>
					                </button>
								</div>
			        		</div>
			        		<div class="fileupload-loading"></div>
						</p>
					</td>
					<th>预览：</th>
					<td>
						<img src='${(article.contentImg)!''}'/>
					</td>
				</tr>
				<tr>
					<th>1</th><td>2</td><th>3</th><td>4</td>
				</tr>
				<tr>
					<td colspan=4>
						<label for="art_editor">Editor 1:</label>
						<textarea cols="80" id="art_editor" name="article.articleContent.content" rows="10" >
							[#if (article.contentList)??]
								[#list article.contentList as content]
									${(content.content)!''}
									[#if content_has_next]
										<div page="true" style="page-break-after: always;">
											<span style="display: none;">[page]&nbsp;[/page]</span>
										</div>
										<p>&nbsp;</p>
									[/#if]
								[/#list]
							[/#if]
						</textarea>
					</td>
				</tr>
			</table>
			[#if act=='update']
				<input type="submit" value="更新"/>
			[#else]
				<input type="submit" value="保存"/>
			[/#if]
			<input id="templateReview" type="button" value="预览"/>
		</form>
		[@ckeditor.replace replace="art_editor" basePath="${base}/js/plugins/ckeditor/" /]
	</div>